const pictrue = {
    state: {
    },
    getters: {
    },
    // 处理同步函数 修改state中数据
    mutations: {
    },
    //处理异步函数 
    actions: {
      // file.raw to base64
      Frw2Base64({commit},file){
        return new Promise((resolve, reject) =>{
            commit('')
            let reader = new FileReader();
            let imgResult = "";
            reader.readAsDataURL(file);
            reader.onload = function() {
              imgResult = reader.result;
            };
            reader.onerror = function(error) {
              reject(error);
            };
            reader.onloadend = function() {
              resolve(imgResult);
            };
        });
      }
    }
  }

  
  export default pictrue